package com.java.demo.time;

import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;

/**
 * @auther zhangwj
 * @date 2020/6/18 8:44 下午
 */
public class Demo {

    public static void main(String[] args) {
        LocalDateTime midnight = LocalDateTime.now().plusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0);
        long millSeconds = ChronoUnit.MILLIS.between(LocalDateTime.now(),midnight);
        long seconds = ChronoUnit.SECONDS.between(LocalDateTime.now(), midnight);
        System.out.println("当天剩余毫秒3：" + millSeconds/1000);
        System.out.println("当天剩余毫秒3：" + seconds);
    }
}
